<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('wechat_service_account_users', function (Blueprint $table) {
            // 在phone字段后添加attribute字段，类型为tinyint，默认值为0
            $table->tinyInteger('attribute')->default(0)->after('phone')->comment('用户属性,默认为0一般用户，1为后台用户');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('wechat_service_account_users', function (Blueprint $table) {
            // 删除attribute字段
            $table->dropColumn('attribute');
        });
    }
};
